{% extends 'base.html' %}
{% block title %} New::Post {% endblock %}

{% block body %}
<div class="row">
    <h1 class="text-center">Create new post</h1>
    <form method="POST" action="{{ url_for('blog.new_post') }}">
        {{ form.hidden_tag() }}
        <div class="form-group">
            {{ form.title.label }}
            {% if form.title.errors %}
                {% for error in errors %}
                <p class="help-block">{{error}}</p>
                {% endfor %}
            {% endif %}
            {{ form.title(class_='form-control') }}
        </div>
        <div class="form-group">
            {{ form.latest_tag.label }}
            {{ form.latest_tag(class_='form-control') }}
        </div>
        <div class="form-group">
            {{ form.text.label }}
            {% if form.text.errors %}
                {% for error in errors %}
                <p class="help-block">{{error}}</p>
                {% endfor %}
            {% endif %}
            {{ form.text(id='editor-content', class_='form-control') }}
        </div>
        <input type="submit" value="Submit" class="btn btn-default">
    </form>
</div>
{% endblock %}

{% block link_for_script %}
<script src="{{ url_for('static', filename='tinymce/js/tinymce/tinymce.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/tinymce_setup.js') }}"></script>
{% endblock %}